package cn.blunce.view_utils.ViewPagerHelper;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;

import java.util.ArrayList;
import java.util.List;

import cn.blunce.mylib.R;

public class ViewPagerTest extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_view_pager_test);

        initView();
    }

    private void initView() {
        LayoutInflater layoutInflater = getLayoutInflater().from(this);
        View view_excutor = layoutInflater.inflate(R.layout.layout_excutor_show,
                null);
        View view_sensor = layoutInflater.inflate(R.layout.layout_sensor_show, null);
        View view_net = layoutInflater.inflate(R.layout.layout_net_show, null);

        List<View> views = new ArrayList<View>();
        views.add(view_excutor);
        views.add(view_sensor);
        views.add(view_net);

        ViewPager viewPager = (ViewPager) findViewById(R.id.content_view);
        viewPager.setAdapter(new MyViewPagerAdapter(views));

        viewPager.setCurrentItem(1);
    }
}
